<template>
    <div class="border-chase">
        <slot />
    </div>
</template>

<script>
export default {
    name: "border-chase",
};
</script>

<style lang="less" scoped>
.border-chase {
    position: relative;
    padding: 20px;

    &::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border: 2px solid gold;
        border-radius: 10px;
        animation: clippath 3s infinite linear;
    }

    &::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border: 2px solid gold;
        border-radius: 10px;
        animation: clip 3s infinite linear;
    }
}

@keyframes clippath {
    0%,
    100% {
        clip-path: inset(0 0 95% 0);
    }

    25% {
        clip-path: inset(0 0 0 95%);
    }

    50% {
        clip-path: inset(95% 0 0 0);
    }

    75% {
        clip-path: inset(0 95% 0 0);
    }
}

@keyframes clip {
    0%,
    100% {
        clip-path: inset(95% 0 0 0);
    }

    25% {
        clip-path: inset(0 95% 0 0);
    }

    50% {
        clip-path: inset(0 0 95% 0);
    }

    75% {
        clip-path: inset(0 0 0 95%);
    }
}
</style>